package com.aixin.csopuser.repository;

import com.aixin.csopuser.domain.AgentInfo;
import com.aixin.csopuser.domain.ServiceConsumeHistory;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Optional;

public interface ServiceConsumeHistoryRepository extends JpaRepository<ServiceConsumeHistory,Long>, JpaSpecificationExecutor<ServiceConsumeHistory> {

//    @Query(value = "select consume from ServiceConsumeHistory consume " +
//            "join ServiceLevelDef sld on sld.serviceID=consume.serviceID " +
//            "where sld.equityID=:equityID and sld.equityLevelID=:equityLevelID")
//    List<ServiceConsumeHistory> getListByEquityIDAndEquityLevelID(@Param("equityID") String equityID, @Param("equityLevelID") String equityLevelID);

    List<ServiceConsumeHistory> findAllByCustomerIDAndEquityIDAndEquityLevelIDOrderByCreateTimeDesc(String customerID, String equityID, String equityLevelID);
}
